package routes

import (
	"server/app/controllers/app"
	"server/app/middleware"
	"server/app/services"

	"github.com/gin-gonic/gin"
)

/* type Response struct {
	Msg  string `json:"msg"`
	Code int    `json:"code"`
} */

func SetUserApiRoutes(router *gin.RouterGroup) {
	router.POST("/auth/login", app.Login)

	// 使用JWTAuth中间件，客户端需要使用正确的token才能访问在authRouter分组下的路由
	authRouter := router.Group("").Use(middleware.JWTAuth(services.AppGuardName))
	{
		authRouter.POST("/auth/info", app.Info)
		authRouter.POST("/auth/logout", app.Logout)   //登出
		authRouter.POST("/auth/setInfo", app.SetInfo) //设置信息
	}
}
